<?php
require_once 'settings/global_settings.php';

require 'frontend/template/header.php';
if(!session_start()) {
	echo "<h1>session aloittamisessa ongelma!</h1>";
	exit(1);
}

echo "<h2>Session ". session_id(). " ". date("l H:i:s d.m.Y") ."</h2>";
if(isset($_SESSION) && count($_SESSION) > 0) {
	echo "<div style='border:1px solid;color: blue;'>\n";
	echo "<h2>Sessio oli jo olemassa, sen tiedot:</h2>";
	foreach ($_SESSION as $k => $v) {
		echo "<h3>$k: $v</h3>";
	}
	echo "</div>";
} else {
	$_SESSION["aika"] = date("l H:i:s m.d.Y");
	echo "<h4>Sessioon lisätty aikaleima ".$_SESSION["aika"]."</h4>";
}

echo "<table>";
foreach ($_SERVER as $k2 => $v2) {
	echo "<tr><td>$k2:</td><td>$v2</td></tr>";
}
echo "</table>";

require 'frontend/template/footer.php';

?>